export var name = "car";

export function Render() {
    return `
  <style>
  
    .container {
      width: 100vw;
      margin: 0 auto;
      background-color: #fff;
      display: flex;
      flex-direction: column;
    }

    .header {
      display: flex;
      align-items: center;
      padding: 1rem 2rem;
      border-bottom: 0.1rem solid #ddd; 
    }

    .header-left {
      display: flex;
      align-items: center;
      margin-right: 7rem;
    }
    .header-left span{
        color: #e5e5e7;
    }
    

    i,span,.menu-btn {
      background: none;
      border: none;
      font-size: 3rem;
      cursor: pointer;
      margin-right: 1rem; 
      color: #000;
    }
    
    .header-title {
      font-size: 3rem;
      font-weight: bold;
    }

    .content img{
      display: block;
      width: 25rem; 
      height: 21rem;
      margin-top: 20rem;
      margin-left: auto;
      margin-right: auto;
    }

    .cart-text {
      display: block;
      margin: 2rem auto 0; 
      color: #999;
      font-size: 1.4rem; 
      text-align: center; 
    }


    /* 登录页面样式 */
    .login-container {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100vw;
      background-color: #fff;
      padding: 2rem;
      border-top: 0.1rem solid #ddd;
      z-index: 2000;
    }

    .login-form {
      display: flex;
      flex-direction: column;
    }

    .login-form label {
      font-size: 1.4rem;
      margin-bottom: 0.5rem;
    }

    .login-form input {
      padding: 1rem;
      margin-bottom: 1rem;
      border: 0.1rem solid #ddd;
      border-radius: 0.4rem;
      font-size: 1.4rem;
    }

    .login-form button {
      padding: 1rem;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 0.4rem;
      font-size: 1.4rem;
      cursor: pointer;
    }

    .login-form a {
      font-size: 1.4rem;
      color: #4CAF50;
      text-decoration: none;
      margin-top: 1rem;
      text-align: center;
    }

    .register-link {
      text-align: center;
      margin-top: 1rem;
      font-size: 1.4rem;
    }

    .register-link a {
      color: #4CAF50;
      text-decoration: none;
    }

    .agreement {
      margin-top: 1rem;
      font-size: 1.2rem;
      text-align: center;
    }

    .agreement a {
      color: #4CAF50;
      text-decoration: none;
    }
  </style>

    <!--页面主题-->
    <div class="container">
      <div class="header">
        <div class="header-left">
          <i class="bi bi-houses fs-1"></i>
          <span>|</span>
          <button class="menu-btn">☰</button>
        </div>
        <div class="header-title">购物车</div>
      </div>
      <div class="content">
        <img src="https://m.v3.shopro.top/static/cart-empty.png" alt="空购物车">
        <div class="cart-text">购物车空空如也，快去逛逛吧~</div>
      </div>
    </div>
    
<!--     登录页面 -->
<!--    <div class="login-container">-->
<!--      <div class="login-form">-->
<!--        <label for="account">账号</label>-->
<!--        <input type="text" id="account" placeholder="请输入账号">-->
<!--        <label for="password">密码</label>-->
<!--        <input type="password" id="password" placeholder="请输入密码">-->
<!--        <button>登录</button>-->
<!--        <a href="#">忘记密码</a>-->
<!--      </div>-->
<!--      <div class="register-link">-->
<!--        <a href="#">立即注册</a>-->
<!--      </div>-->
<!--      <div class="agreement">-->
<!--        我已阅读并遵守 <a href="#">《用户协议》</a> 与 <a href="#">《隐私协议》</a>-->
<!--      </div>-->
<!--    </div>-->
    <div class="login-container">
    <!-- 标题部分 -->
    <div class="title">
        <a href="#" class="active">账号登录</a>
        <a href="#">短信登录</a>
    </div>

    <!-- 提示文字 -->
    <div class="hint">
        如果未设置过密码，请点击忘记密码
    </div>

    <!-- 账号输入框 -->
    <div class="form-group">
        <label for="account">账号</label>
        <input type="text" id="account" placeholder="请输入账号">
    </div>

    <!-- 忘记密码链接 -->
    <div class="forgot-password">
        <a href="#">忘记密码</a>
    </div>

    <!-- 密码输入框 -->
    <div class="form-group">
        <label for="password">密码</label>
        <input type="password" id="password" placeholder="请输入密码">
    </div>

    <!-- 登录按钮 -->
    <button class="login-btn">登录</button>

    <!-- 立即注册链接 -->
    <div class="register-link">
        <a href="#">立即注册</a>
    </div>

    <!-- 协议勾选 -->
    <div class="agreement">
        <input type="checkbox" id="agreement" checked>
        <label for="agreement">我已阅读并遵守《用户协议》与《隐私协议》</label>
    </div>
</div>

        `
}

Render();

export function AfterRender() {

    // 设置蒙版
    function createOverlay() {
        const overlay = document.createElement('div');
        overlay.style.position = 'fixed';
        overlay.style.top = 0;
        overlay.style.left = 0;
        overlay.style.width = '100vw';
        overlay.style.height = '100vh';
        overlay.style.background = 'rgba(0, 0, 0, 0.5)';
        overlay.style.zIndex = 1000;
        document.body.appendChild(overlay);
    }
    createOverlay();
}
AfterRender()